package com.chushouya.common.enums;



import com.general.framework.core.enums.IEnum;
import com.general.framework.core.lang.Strings;

import java.util.Objects;

public enum ExpressContactTypeEnum implements IEnum<Integer> {
    //收件人
    RECEIVER(1, "收件人"),
    //寄件人
    SENDER(2, "寄件人");

    private Integer value;

    private String desc;

    ExpressContactTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDesc(Integer status) {
        for (ExpressContactTypeEnum thisEnum : ExpressContactTypeEnum.values()) {
            if (Objects.equals(thisEnum.value, status)) {
                return thisEnum.desc;
            }
        }
        return Strings.EMPTY;
    }

    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
